#@adminLayout()
#define main()
<div class="card">
    <div class="card-header">
        <h2 class="card-title text-info">配置传感器有效性</h2>
        <div class="progress">
            <div class="progress-bar bg-success" role="progressbar" style="width: 100%" aria-valuenow="100"
                 aria-valuemin="0"
                 aria-valuemax="100"></div>
        </div>
    </div>
    <div class="card-block">
        <table class="table table-sm mb-0">
            <thead>
            <tr>
                <th>序号</th>
                <th>名称</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
                #for(x:dictionaryList)
                <tr>
                    <td>#(x.number)</td>
                    <td>#(x.name)</td>
                    <td>
                        <div class="form-group card-title">
                            <div class="toggle-switch toggle-switch--green">
                                <input type="checkbox" value="#(validityList[for.index])" class="toggle-switch__checkbox" onclick="changValidity('#(equipment.id)','#(x.number)',this.value)" #if(validityList[for.index].toString()=="1") checked #end>
                                <i class="toggle-switch__helper"></i>
                            </div>
                        </div>
                    </td>
                </tr>
                #end
            </tbody>
        </table>
    </div>
</div>
#end
<script>
    //修改状态值
    function changValidity(a,b,c) {
        $.post("/admin/ciis/equipment/changeValidity",{equimentId:a,number:b,state:c},function (ret) {
            showRetMsg(ret,"/admin/ciis/equipment/configure?id="+a);
        })
    }
</script>
